import request from '@/utils/request'

export function getProductPage(params) {
  return request({
    url: '/v1/product/page',
    method: 'get',
    params
  })
}

export function getProduct(params) {
  return request({
    url: '/v1/product/detail',
    method: 'get',
    params
  })
}

export function getCategoryChildren(params) {
  return request({
    url: '/v1/category/categoryChild',
    method: 'get',
    params
  })
}

export function createProduct(data) {
  return request({
    url: '/v1/product/save',
    method: 'post',
    data
  })
}

export function updateProduct(data) {
  return request({
    url: '/v1/product/update',
    method: 'put',
    data
  })
}

export function updateProductItem(data) {
  return request({
    url: '/v1/product/updateProduct',
    method: 'put',
    data
  })
}

export function deleteProduct(params) {
  return request({
    url: '/v1/product/remove',
    method: 'delete',
    params
  })
}

export function getSeasonsCategory(params) {
  return request({
    url: '/v1/seasonsCategory/list',
    method: 'get',
    params
  })
}
